package com.example.demo.framework;

public enum ErrorCode {

	SUCCESS_10000("10000", "SUCCESS"),
	ERROR_10001("10001", "用户名或密码错误"), 
	ERROR_10002("10002", "参数验证不合法"), 
	ERROR_10003("10003", "用户登录已过期，请重新登录"),
	ERROR_10004("10004", "你没有权限"),
	ERROR_10005("10005", "你的余额不足"),
	ERROR_10051("10051", "图片上传大小不能超过5M"),
	ERROR_10052("10052", "图片上传类型不正确"),
	ERROR_10053("10053", "图片上传失败"),
	ERROR_10054("10054", "图片为空"),
	ERROR_10101("10101", "商品不存在"),
	ERROR_10102("10102", "商品操作异常"),
	ERROR_10103("10103", "商品规格已下架或已售罄"),
	ERROR_10104("10104", "商品库存不足"),
	ERROR_10105("10105", "该商品已存在"),
	ERROR_10111("10111", "商品分类已存在"),
	ERROR_10112("10112", "仓库已存在"),
	ERROR_10113("10113", "上级仓库不存在"),
	ERROR_10114("10114", "仓库已删除"),
	ERROR_10115("10115", "不在同一仓库的商品不能同时下单"),
	ERROR_10201("10201", "代理商账号已存在"),
	ERROR_10202("10202", "代理商账号不存在"),
	ERROR_10301("10301", "订单不存在"),
	ERROR_10302("10302", "订单操作异常"),
	ERROR_10303("10303", "该订单已经退款"),
	ERROR_10304("10304", "支付密码不正确"),
	ERROR_10351("10351", "售后不存在"),
	ERROR_10352("10352", "售后已存在"),
	ERROR_10401("10401", "等级不存在"),
	ERROR_10501("10501", "充值记录不存在"),
	ERROR_10502("10502", "充值记录状态错误"),
	ERROR_10999("10999", "系统错误");

	private String code;
	private String msg;

	private ErrorCode(String code, String msg) {
		this.setCode(code);
		this.setMsg(msg);
	}
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@Override
	public String toString() {
		return this.code + ";" + this.msg;
	}

}
